/**
 * @(#)MsgActivity.java
 * 
 * @Version: 1
 * @JDK: jdk 1.6.0.XXX
 * @Module: MBA
 */
/*- 				History
 **********************************************
 *  ID      DATE           PERSON       REASON
 *  1     2013-03-04     Yongkai.Yu    Created
 **********************************************
 */

package com.mba.activity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.BaseAdapter;
import android.widget.BaseExpandableListAdapter;
import android.widget.Button;
import android.widget.ExpandableListAdapter;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioGroup;
import android.widget.SimpleAdapter;
import android.widget.Spinner;
import android.widget.TabHost;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TabHost.OnTabChangeListener;
import android.widget.TabHost.TabSpec;
import android.widget.TabWidget;

import com.mba.adapter.ContentActivityAdapter;
import com.mba.adapter.HomeAdapters;
import com.mba.adapter.HomeListAdapter;
import com.mba.base.BaseActivity;
import com.mba.bean.ContentInfo;
import com.mba.util.Tools;

/**
 * 消息Activity
 */
public class MsgActivity extends TabActivity {
	

    // 保存需要显示的多条微博数据
    public ArrayList<ContentInfo> contentList;
    // 使用GridView定义的顶部菜单
//    private GridView gv_title_menu;
    private TabHost mTabHost;
    private RadioGroup msgActivityTab;
    private final static String TAB_MSG_REPLY="tab_msg_reply";
    private final static String	TAB_TAG_CHAT = "this";
    Intent intent;
    Intent intent2;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        setContentView(R.layout.msg);
        init();
       // loadButtomMenu();
        
        pare();
        mInit();
        TabWidget tabWidget = mTabHost.getTabWidget();
		int count = tabWidget.getChildCount();
		for(int i = 0;i<count;i++){
		        View view = tabWidget.getChildTabViewAt(i);
		        view.getLayoutParams().height = 50;
		}
		
	}
	
	void pare(){
		intent = new Intent(MsgActivity.this,ConversationActivity.class);
		intent2 = new Intent(MsgActivity.this,MsgRecivePageActivity.class);
	}
	
	/**
	 * 
	 */
	private void mInit() {
		this.mTabHost = getTabHost();
		mTabHost.addTab(buildTabSpec("TAB_MSG_REPLY",R.string.menu_msg,intent2));
		mTabHost.addTab(buildTabSpec("TAB_TAG_CHAT",R.string.reply,intent));
		
	}


	/**
	 * @param tabTagHome
	 * @param mainNews
	 * @param icon1n
	 * @param mHomeIntent
	 * @return
	 */
	private TabHost.TabSpec buildTabSpec(String tag, int resLabel, final Intent content) {
		return this.mTabHost.newTabSpec(tag).setIndicator(getString(resLabel)).setContent(content);
	} 

	/**
     * 加载消息数据
     */
    public void init() {
    	
    }
    
    
    /**
     * 加载菜单数据 
     */
    /*
    private void loadButtomMenu() {
    	
    	
    	gv_title_menu = (GridView) this.findViewById(R.id.msg_title);
    	gv_title_menu.setNumColumns(2);// 总共显示多少项
    	gv_title_menu.setGravity(Gravity.CENTER);
    	gv_title_menu.setVerticalSpacing(5);// 垂直间隔
    	gv_title_menu.setHorizontalSpacing(5);// 水平间隔

        ArrayList data = new ArrayList();
        HashMap map = new HashMap();
        map.put("itemImage", R.drawable.pl);
        map.put("itemText", "回复");
        data.add(map);
        map = new HashMap();
        map.put("itemImage", R.drawable.pl);
        map.put("itemText", "私信");
        data.add(map);
       // map = new HashMap();
        //map.put("itemImage", R.drawable.pl);
        //map.put("itemText", "评论");
        //data.add(map);

        SimpleAdapter adapter = new SimpleAdapter(this, data,
                R.layout.item_menu, new String[] { "itemImage", "itemText" },
                new int[] { R.id.item_image, R.id.item_text });

        gv_title_menu.setAdapter(adapter);
        gv_title_menu.setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                    int position, long id) {
                
            }
        });
    }
    */
    


    
}
